function [xy, xz, yz] = show_volume(im3D, adjust, resize)
%% show volume


if nargin == 3
    im3D = imresize3(im3D, [floor(size(im3D, 1)*resize(1)), floor(size(im3D, 2)*resize(2)), floor(size(im3D, 3)*resize(3))]);
end

if nargin >= 2
    if adjust
        xz = imadjust(squeeze(max(im3D, [], 1)));
        yz = imadjust(squeeze(max(im3D, [], 2)));
        xy = imadjust(squeeze(max(im3D, [], 3)));
        
    else
        xz = squeeze(max(im3D, [], 1));
        yz = squeeze(max(im3D, [], 2));
        xy = squeeze(max(im3D, [], 3));
    end
elseif nargin == 1
    xz = squeeze(max(im3D, [], 1));
    yz = squeeze(max(im3D, [], 2));
    xy = squeeze(max(im3D, [], 3));
end


% xz = squeeze(im3D(:,350,:));
% yz = squeeze(im3D(350,:,:));
% xy = squeeze(im3D(:,:,20));

% xz = imadjust(squeeze(max(im3D, [], 1)));
% yz = imadjust(squeeze(max(im3D, [], 2)));
% xy = imadjust(squeeze(max(im3D, [], 3)));

figure,
% W = 1200;
% H = 400;
% B = 10;
% 
% set(gcf, 'Position', [0,0,W,H]);
% [sizey, sizex, sizez] = size(im3D);
% 
% h1 = axes;
% set(h1, 'position', [0,0,sizex/W, sizez/H])
% imagesc(xz), axis equal, title('xz'), axis off

xz = double(xz)/double(max(xz(:)));
yz = double(yz)/double(max(yz(:)));
% colormap('gray');
subplot(1,2,1), imagesc(xz, [0,0.5]), axis equal, title('xz'), axis off
% colormap('gray');
subplot(1,2,2), imagesc(yz, [0,0.5]), axis equal, title('yz'), axis off
figure,
% colormap('gray');
xy = double(xy)/double(max(xy(:)));
imagesc(xy, [0,0.5]), axis equal, title('xy'), axis off
end


